#ifndef CDOWNLOADER_H
#define CDOWNLOADER_H

#include <QCoreApplication>
#include <QFile>
#include <QFileInfo>
#include <QList>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QStringList>
#include <QTimer>
#include <QUrl>

class CDownloader : public QObject
{
    Q_OBJECT
    QNetworkAccessManager manager;
    QByteArray m_data;

    int m_error;
    QString m_errorStr;
    QNetworkReply *m_reply;
    bool m_is404;
public:
    CDownloader();
    ~CDownloader();
    void doDownload(const QUrl &url);

    int error() { return m_error; }
    bool is404() { return m_is404; }
    QByteArray data() { return m_data; }

public slots:
    void downloadFinished(QNetworkReply *reply);

signals:
    void finished();
};

#endif // CDOWNLOADER_H
